import { wechatrequest } from './API/request'
import { getGlobalData } from '../configuration/globaldata'
import { getStorageSync } from '../crossplatform/apiservice/storage'

/**
 * 实名认证
 */
export const applyRequest = ({ identPicUrl, userId, userName }) => {
  const userinfo = getStorageSync('userinfo')
  const companyName = userinfo && userinfo.companyName
  return wechatrequest.postparams('/realName/add/apply', {
    data: { companyName, identPicUrl, userId, userName }
  })
}

/**
 * 查询实名认证
 */
export const infoRequest = ({ userId }) => {
  return wechatrequest.postparams('/realName/ident/info', {
    data: { userId }
  })
}
